import factory from './schema-factory';


export default factory({
    type: 'page',
    body: {
        type: 'wrapper',
        className: 'container w-xxl w-auto-xs',
        body: {
            type: 'form',
            className: 'm-t-lg',
            wrapWithPanel: false,
            redirect: '/home',
            api: '/api/login/sms',
            controls: [
                {
                    type: 'tpl',
                    tpl: '<%= window.vars && window.vars.orgName || "志多星" %>管理系统登录',
                    className: 'navbar-brand text-2x block m-t no-shadow m-b'
                },

                {
                    type: 'panel',
                    className: 'no-border no-bg no-shadow',
                    bodyClassName: 'no-padder',
                    formClassName: 'list-group',
                    controls: [
                        {
                            label: "手机",
                            type: "text",
                            name: "phone",
                            required: true
                        },

                        {
                            label: "短信验证码",
                            type: "phone-code",
                            name: "code",
                            sendApi: 'post:/api/login/verifyphone?type=2',
                            phoneFieldName: "phone",
                            width: 170,
                            required: true
                        },
                    ]
                },

                {
                    type: 'submit',
                    block: true,
                    label: '登录',
                    size: 'lg',
                    primary: true
                },
                {
                    type: 'tpl',
                    tpl: '<p class="text-center"><small>已拥有账号？</small></p>'
                },
                {
                    type: 'button',
                    level: 'info',
                    block: true,
                    label: '账号密码登录',
                    size: 'lg',
                    actionType: 'link',
                    link: '/login',
                    noOffset: true
                },

                // {
                //     type: 'tpl',
                //     className: 'm-t-lg',
                //     tpl: '<p class="text-center"><small>没有账号？</small></p>'
                // },

                // {
                //   type: 'button',
                //   block: true,
                //   label: '团队注册',
                //   size: 'lg',
                //   actionType: 'link',
                //   link: '/register'
                // },

                {
                    type: 'tpl',
                    className: 'text-center',
                    tpl: `<p><small class="text-muted">志多星管理系统<br>© 2017</small></p>`
                }
            ]
        }
    }
}, '找回密码');
